package modelLayer;
import java.io.Serializable;
import java.util.ArrayList;

/**
 * 
 * @author Nick D Pedersen 
 * @version 1.0
 * 
 */
public class Owner implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private int id;
	private static int idIterator = 0;
    private String name;
    private String address;
    private int phoneNumber;
    private ArrayList<Forest> forests;
    
    /**
     * Constructor for objects of class Owner
     * @Param String name - The name of the owner
     * @Param String address - The owners address
     * @Param int phoneNumer - The owners phone number
     */
    public Owner(String name, String address, int phoneNumber){
    	this.id = idIterator;
        this.name = name;
        this.address = address;
        this.phoneNumber = phoneNumber;
        forests = new ArrayList<Forest>();
        idIterator++;
    }

    /**
     * Get'n Setters
     */
    
    public ArrayList<Forest> getForests(){
        return forests;
    }
    public void addForest(Forest f){
        forests.add(f);
    }
    public void removeForest(Forest f){
    	forests.remove(f);
    }
    public String getName(){
        return name;
    }
    public void setName(String name){
        this.name = name;
    }
    public String getAddress(){
        return address;
    }
    public void setAddress(String address){
        this.address = address;
    }
    public int getPhoneNumber(){
        return phoneNumber;
    }
    public void setPhoneNumber(int phoneNumber){
        this.phoneNumber = phoneNumber;
    }
    
    /**
     * Prints all the information from the class Owner.
     */
    public String toString(){
        String s = name;
        return s;
    }

	public int getId() {
		return id;
	}
}
